-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(ember): v2 #19229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat(ember): v2 #19229
Conversation
53dd617 to
822ed0a
Compare
nicohrubec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for contributing. A few notes:
- This PR is way too large. Please split it up into smaller pieces so we can review it properly.
- Is there a way to get this done without introducing breaking changes? If no, then we need to wait with this until our next major.
Hi @nicohrubec, thanks for the feedback! I understand the concern about PR size. Unfortunately, the v1 → v2 addon migration is an atomic change — you can't incrementally migrate between formats. The build pipeline, entry point structure, and package.json layout must change together for the addon to function. That said, the core SDK functionality is unchanged — the same instrumentation, error handling, and performance tracking code. The changes fall into two categories:
The actual instrumentation logic in I'm happy to:
Regarding breaking changes — the v2 format requires explicit Let me know how you'd like to proceed! |
822ed0a to
4874c99
Compare
|
@aklkv thanks a lot for doing this!🙏 FWIW: While waiting for this, I realized I didn't use the performance part of the addon, and was able to just use the That also means that the 'breaking change' mentioned in the PR is a very welcome change to reduce the scope of what is delegated to the 'ember' part of the addon. Most is now just handled by the core apis, which it how it should be👍 (the link to Ember v2 addon format is broken in the pr description, btw) |
NullVoxPopuli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good PR.
I understand the maintainer's perspective of wanting it split up tho.
The only way to do so would be rearranging the monorepo a bit to make a separate test app package.
This would mean the goal of that PR is to just delete the dummy app from the existing v1 addon.
That will still be a large pr, and i don't really see a way to get better than 2 large prs for this needed work.
Maintainers,
You mentioned breaking change timing - i suspect that is because all packages in this repo are released at once?
May i introduce you to https://github.com/release-plan/release-plan ?
It allows each package to be published independently with correct semver inference based on changes in git (and labels assessing impact on a pr) it helps a lot!
| <meta name="description" content=""> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
|
||
| <script>if(window.performance&&window.performance.mark){window.performance.mark('@sentry/ember:initial-load-start');}</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these additions for? Are they needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is an app file, did the readme get updated to reflect the situation that wants this added?
Is it required?
packages/ember/addon/runloop.d.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good riddance
| } | ||
| } | ||
|
|
||
| export default instrumentRoutePerformance(WithLoadingIndexRoute); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice way to do this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! My questions were answered here in this doc! Tyty!
4874c99 to
34b116c
Compare
34b116c to
3f38914
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| * }; | ||
| * ``` | ||
| */ | ||
| export async function setupPerformance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary async masks errors as unhandled rejections
Medium Severity
setupPerformance is declared async but contains no await statements. The old instrumentForPerformance needed async because it had await import('@sentry/browser'), but the new code replaced that with static imports. Since all documentation and examples show calling setupPerformance without await (the instance-initializer returns void), any synchronous error thrown inside (e.g., from appInstance.lookup) becomes an unhandled promise rejection instead of propagating to Ember's boot error handling. This could silently swallow performance setup failures, making them very hard to debug.
Additional Locations (1)
| true, | ||
| 'runloop spans not captured (expected in strict resolver test environment)', | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runloop span test assertion unconditionally passes
Medium Severity
The runloop span assertion in assertSentryTransactions now unconditionally passes — if runloop spans exist, it asserts true (trivially true from the condition), and if they don't, it asserts assert.true(true, ...). This means regressions in runloop instrumentation can never be detected by the test suite. The old code had a real assertion that could fail. Per the review rules for feat PRs, tests need to actually test the newly added behavior.


Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint) & (yarn test).Summary
Migrates
@sentry/emberfrom the legacy v1 addon format to the Ember v2 addon format. This modernizes the package to work with both classic Ember builds and Embroider-optimized builds, and removes the runtime dependency on@embroider/macros.Changes
ember-clibuild pipeline withrollup(transpilation →dist/) +tsc(declarations →declarations/)addon-main.cjsusing@embroider/addon-shimas the addon entry pointember-addon.version: 2, updatedexportsmap, addedember-addon.app-jsmapping@embroider/macrosgetOwnConfig()with explicitSentry.init()calls and a newsetupPerformance()exportAPI changes:
init()is now called directly inapp.tsor an initializer (no moreENV['@sentry/ember']config)setupPerformance()must be called from an instance-initializer to opt into performance instrumentation<script>tags inindex.htmlUPGRADE.mdwith detailed migration guideTest & CI updates:
ember-classic,ember-embroider) to use v2 patterns:ENV['@sentry/ember']toSentry.init()inapp.ts<script>tags toindex.html.github/workflows/build.ymlCACHED_BUILD_PATHSfrompackages/ember/*.d.tstopackages/ember/dist+packages/ember/declarationsTypeScript fixes:
"types": ["ember-source/types"]totsconfig.publish.jsonfor Ember module resolution during declaration generation@ember/routing/-private/transition)instrumentFunctiongeneric to avoid tuple mismatch errorsBreaking Changes
ENV['@sentry/ember']config inconfig/environment.jsis no longer supported — useSentry.init()directlysetupPerformance()from an instance-initializer<script>tags inapp/index.htmlCloses #15835